<!DOCTYPE html>
<!-- saved from url=(0057)https://m.zuche.com/html5/newversion/member/password.html -->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="/css/H5phone/pwd_files/hm.js.下载"></script>
<script src="/css/H5phone/pwd_files/lc.js.下载"></script>

<link href="http://m.zuche.com/" rel="dns-prefetch">
<title>神州租车—中国租车领导者!天天超低价!!!</title>
<meta name="description"
	content="神州租车-全国70大城市,90大机场高铁,万辆新车,不限里程,价格超低,手续便捷,服务尽心,24小时服务,携手贝克汉姆共启云战略.Tel:400-616-6666">
<meta name="keywords"
	content="租车，租车网，租车公司，汽车租赁，H_lYMbU-rQ0RUInbjlkbxqyQBhQ">
<meta name="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-title" content="神州租车">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="baidu-tc-cerfication"
	content="55c603db1cd78c7f7ab7686162824f23">
<link rel="stylesheet" type="text/css"
	href="/css/H5phone/pwd_files/common@ee713f7a54.css">
<link rel="stylesheet" type="text/css"
	href="/css/H5phone/pwd_files/ShortRentDrive@a163375f50.css">
<link rel="stylesheet" type="text/css"
	href="/css/H5phone/pwd_files/personalCenter@ce36964027.css">

</head>

<body rlt="1" style="">
	<header>
		<div class="getback" style="white-space: normal">
			<span class="getbackimg">&nbsp;</span>
		</div>
		<h1 class="header_title">修改密码</h1>
	</header>
	<section class="password" style="padding-bottom: 60px;">
		<p>原密码</p>
		<div>
			<input type="password" placeholder="请输入您现在使用的密码" id="oldPwd"
				maxlength="18">
		</div>
		<div style="display: none" id ="olPwd">
		<#if userPwd??>
		${userPwd}
		</#if>
		</div>
		<p>新密码</p>
		<div>
			<input type="password" placeholder="由6-18字母，数字组成" id="pwd"
				maxlength="18">
		</div>
		<p>确认密码</p>
		<div>
			<input type="password" placeholder="请再输入一遍，确认正确" id="confirmPwd"
				maxlength="18">
		</div>
	</section>
	<footer class="btncenter">
		<button type="button" name="" id="updatePwd" class="orangebut">确认修改</button>
	</footer>

	<div id="loading-mask" class="mask" style="display: none;">
		<div class="loading-new">
			<span class="l-logo"></span><span class="l-film animate-loading"></span>
		</div>
	</div>
	<div class="dialogSuccess" style="display: none">
		<div class="dialog-closeSuccess" onclick="closeM()"></div>
		<div id="message" class="dialog-contentSuccess"></div>
	</div>

	<script type="text/javascript" src="/js/jquery-3.2.1.js"></script>

	<script>
	
	
	
	$(".orangebut").click(function(){
		var oldPwd = $("#oldPwd").val();
		var yanoldPwd = $("#olPwd").html().trim();
		if(oldPwd!=yanoldPwd){
			$(".dialogSuccess").css("display","block")
			$("#message").text("旧密码输入错误,请重新输入")
			$("oldPwd").val("");
			return flase;
		}
		var newPwd = $("#pwd").val();
		var confirmPwd = $("#confirmPwd").val();
		
		if (newPwd.length != 0) {
			if (newPwd.length > 8 && newPwd.length < 6) {
				$(".dialogSuccess").css("display","block")
				$("#message").text("密码在6-8位字母，请重新输入")
				return false;
			}
			pwd = /^(?![^a-zA-Z]+$)(?!\D+$)/;
			if (!pwd.test(newPwd)) {
				$(".dialogSuccess").css("display","block")
				$("#message").text("密码请包涵数字字母，请重新输入")
			
				return false;
			}
		} else {
			$(".dialogSuccess").css("display","block")
			$("#message").text("密码不能为空，请重新输入")
		
			return false;
		}
		//确认
		if (confirmPwd.length != 0) {
			if (confirmPwd != newPwd) {
				$(".dialogSuccess").css("display","block")
				$("#message").text("两次密码不一致，请重新输入")
				return false;
			}
		} else {
			$(".dialogSuccess").css("display","block")
			$("#message").text("确认密码不能为空，请重新输入");
			return false;
		}
		
		$.ajax({
			type : "get",//请求类型
			url : "/users/pwdUpd",
			data : {
				"userPwd" : confirmPwd
			},//请求参数
			dataType : "json",//ajax接口（请求url）返回的数据类型
			success : function(data) {//data：返回数据（json对象）
				if(data.msg){
					$(".dialogSuccess").css("display","block")
					$("#message").text("密码修改成功，即将跳往登陆页面！");
					setTimeout(function(){
						location.href="/jump/logins";
					},1500)
				}else{
					$(".dialogSuccess").css("display","block")
					$("#message").text("密码修改失败！");
				}
				
			},
			error : function(data) {//当访问时候，404，500 等非200的错误状态码
				alert(1111111111111111111)
			}

		});
		
		
	})
	
	
	
		$(".getback").click(function() {
			window.location.href ="/jump/passpages";
		})
		
		closeM = function() {
					$("#message").text("");
					$(".dialogSuccess").hide();
		}
	</script>
</body>

</html>